V2EX  ›  英汉词典

Template Parameter

释义 Definition

模板参数:在编程语言(尤其是 C++)中,用来给模板提供类型或常量等信息的占位符,使同一份代码可以根据不同输入生成不同的具体版本。常见有 type template parameter(类型模板参数)non-type template parameter(非类型模板参数) 等。

发音 Pronunciation (IPA)

/ˈtɛmpleɪt pəˈræmɪtər/

例句 Examples

A template parameter can be a type.
模板参数可以是一个类型。

By adjusting the template parameter, the same function can work efficiently for both integers and floating-point numbers without duplicating code.
通过调整模板参数,同一个函数无需重复代码就能高效地同时适用于整数和浮点数。

词源 Etymology

template(模板) + parameter(参数) 组合而成。template 原指“样板/模板”,在编程中引申为“可生成多种具体实现的代码框架”;parameter 指“输入条件/参数”。合在一起即“用于模板生成具体版本的参数”。

相关词 Related Words

文学与著作 Literary Works

  • C++ Templates: The Complete Guide(David Vandevoorde, Nicolai M. Josuttis, Douglas Gregor)
  • The C++ Programming Language(Bjarne Stroustrup)
  • *Effective C++*(Scott Meyers)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   788 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 18:51 · PVG 02:51 · LAX 10:51 · JFK 13:51
♥ Do have faith in what you're doing.